<template>
  <div>
    <avue-form ref="formInfoList" v-model="data" :option="formOption" />
  </div>
</template>
<script>
const DIC = {
  VAILD: [{
    label: '',
    value: '1'
  }],
  SEX: [{
    label: '男',
    value: 0
  }, {
    label: '女',
    value: 1
  }]
}
export default {
  name: 'FormInfoList',
  props: {
    info: {
      type: Object,
      default: null
    }
  },
  data() {
    return {
      DIC: {
  VAILD: [{
    label: '1',
    value: '1'
  }],
  SEX: [{
    label: '男',
    value: 0
  }, {
    label: '女',
    value: 1
  }]},
  VAILD: [{
    label: '1',
    value: '1'
  }],
      infoList: {},
      data: {
        tableName: '',
        pageTitle: '',
        pageTheme: '00',
        isPage: '1',
        isTree: '1',
        remarks: ''
      },
      formOption: {
        menuBtn: false,
        column: [
          {
            label: '表名',
            prop: 'tableName',
            rules: [
              {
                required: true,
                trigger: 'blur',
                message: '请输入表名'
              }
            ],
            span: 6
          },
          {
            label: '标题',
            prop: 'pageTitle',
            rules: [
              {
                required: true,
                trigger: 'blur',
                message: '请输入表描述'
              }
            ],
            span: 6
          },
          {
            label: '主题',
            prop: 'pageTheme',
            type: 'select',
            value: '00',
            dicUrl: '/api-sys/sys/dict/autoCache/D000016',
            span: 6
          },
          {
            label: '分页',
            prop: 'isPage',
            type: 'select',
            dicUrl: '/api-sys/sys/dict/autoCache/D000006',
            value: '1',
            span: 6
          },
          {
            label: '树形',
            prop: 'isTree',
            type: 'select',
            value: '0',
            dicUrl: '/api-sys/sys/dict/autoCache/D000007',
            span: 6
          },
          {
            label: '新增',
            prop: 'isAdd',
            type: 'checkbox',
            dicData: DIC.VAILD,
            value: '1',
            span: 2
          },
          {
            label: '编辑',
            prop: 'isEdit',
            type: 'checkbox',
            dicData: DIC.VAILD,
            value: '1',
            span: 2
          },
          {
            label: '删除',
            prop: 'isDelete',
            type: 'checkbox',
            dicData: DIC.VAILD,
            value: '1',
            span: 2
          },
          // {
          //   label: '导入',
          //   prop: 'isImport',
          //   type: 'checkbox',
          //   dicData: DIC.VAILD,
          //   value: '0',
          //   span: 2
          // },
          // {
          //   label: '导出',
          //   prop: 'isExport',
          //   type: 'checkbox',
          //   dicData: DIC.VAILD,
          //   value: '0',
          //   span: 2
          // },
          {
            label: '备注',
            prop: 'remarks',
            type: 'textarea',
            span: 24
          }
        ]
      },
      editForm: {}
    }
  },
  watch: {
    info: {
      handler(val) {
        this.data = val
      },
      immediate: true,
      deep: true
    },
    data: {
      handler(val) {
        this.$emit('update:info', val)
      },
      deep: true
    }
  },
  mounted() {
  }
}
</script>
<style lang="scss">
</style>
